﻿<ResourceDictionary x:Class="Axiom.CodeManifold.WPF.Styles"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    mc:Ignorable="d">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="Brushes.xaml"/>
		<ResourceDictionary Source="Menu.xaml"/>
		<ResourceDictionary Source="ComboBox.xaml"/>
		<ResourceDictionary Source="ScrollBar.xaml"/>
		<ResourceDictionary Source="TabItem.xaml"/>
	</ResourceDictionary.MergedDictionaries>
	<Style TargetType="{x:Type TabItem}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabItem}">
					<Grid>
						<Border Name="Border" Margin="0,0,0,0" Background="Transparent" BorderBrush="Gray" BorderThickness=".5">
							<ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="12,2,12,2" RecognizesAccessKey="True"/>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsSelected" Value="True">
							<Setter Property="Panel.ZIndex" Value="100" />
							<Setter TargetName="Border" Property="Background" Value="Silver" />
							<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
						</Trigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter TargetName="Border" Property="Background" Value="DarkRed" />
							<Setter TargetName="Border" Property="BorderBrush" Value="Black" />
							<Setter Property="Foreground" Value="DarkGray" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="{x:Type Button}" x:Key="ButtonStyle" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
		<Setter Property="Padding" Value="0"/>
		<Setter Property="MinWidth" Value="5"/>
	</Style>
	<Style x:Key="ControlToolbox" TargetType="ContentControl">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ContentControl">
					<StackPanel Orientation="Horizontal">
						<Button Style="{StaticResource ButtonStyle}" Name="MinimiseButton" Tag="minimise" Click="OnControlToolboxButtonClick" Background="Gray">
							<Image Source="/Axiom.CodeManifold.WPF;component/Assets/Images/Controls/1.png" Stretch="None"/>
						</Button>
						<Button Style="{StaticResource ButtonStyle}" Name="RestoreButton" Tag="restore" Click="OnControlToolboxButtonClick" Background="Gray">
							<Image Source="/Axiom.CodeManifold.WPF;component/Assets/Images/Controls/2.png" Stretch="None"/>
						</Button>
						<Button Style="{StaticResource ButtonStyle}" Name="CloseButton" Tag="close" Click="OnControlToolboxButtonClick" Background="Gray">
							<Image Source="/Axiom.CodeManifold.WPF;component/Assets/Images/Controls/3.png" Stretch="None"/>
						</Button>
					</StackPanel>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="MainWindowStyle" TargetType="Window">
		<Setter Property="MinHeight" Value="300" />
		<Setter Property="MinWidth" Value="500" />
		<Setter Property="WindowStyle" Value="None" />
		<Setter Property="ResizeMode" Value="CanResizeWithGrip" />
		<Setter Property="ShowInTaskbar" Value="True" />
		<Setter Property="AllowsTransparency" Value="True" />
		<Setter Property="Background" Value="White" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="Window">
					<Border BorderBrush="White" BorderThickness=".66" Margin="5" Background="White">
						<Border.Effect>
							<DropShadowEffect BlurRadius="5" ShadowDepth="5" Opacity=".5"/>
						</Border.Effect>
						<Border BorderBrush="#FF4B4B4B" BorderThickness="3">
							<Grid >
								<Grid.RowDefinitions>
									<RowDefinition Height="45"/>
									<RowDefinition Height="*"/>
									<RowDefinition Height="auto"/>
								</Grid.RowDefinitions>
								<Grid MouseMove="Window_MouseMove" MouseDown="Grid_MouseDown">
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="auto" />
										<ColumnDefinition Width="*" />
										<ColumnDefinition Width="auto" />
									</Grid.ColumnDefinitions>
									<Image Source="/Axiom.CodeManifold.WPF;component/Assets/Images/ViewThumbnail.png" Height="25" VerticalAlignment="Top" Margin="5"/>
									<TextBlock Text="code manifold" Foreground="Silver" Margin="3" Grid.Column="1" FontSize="10" FontWeight="Bold" FontFamily="Calibri"/>
									<ContentControl Style="{StaticResource ControlToolbox}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0" Grid.Column="2" />
								</Grid>
								<ContentPresenter Grid.Row="1" Margin="0,0,0,0"/>
								<ResizeGrip Grid.Row="1" 
											Margin="0,0,-1,-2" 
											HorizontalAlignment="Right" 
											VerticalAlignment="Bottom" 
											PreviewMouseLeftButtonDown="OnResize" 
											MouseMove="OnDisplayResizeCursor"/>
							</Grid>
						</Border>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>